{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div class="worksheet-container">
  <ul class="worksheet-nav row nav nav-tabs inverse">
    {{#each worksheets as |worksheet index| }}
      <li class="{{if worksheet.selected 'active'}}" style="" {{action "openWorksheetRenameModal" wf.title on="doubleClick"}}>
        {{#link-to 'queries.query' worksheet.id  classBinding='worksheet.selected:active' }}{{ worksheet.title }}
          {{#if worksheet.isQueryDirty}}*{{/if}}
          {{#if (gt worksheets.length 1)}}
            <span class="closeTab" {{action "confirmWorksheetClose" index worksheet.id bubbles=false }}>{{fa-icon "times"}}</span>
          {{/if}}
        {{/link-to}}
      </li>
    {{/each}}
    <li>
      <button class="btn btn-default new-worksheet" title="New Worksheet" {{action "createNewWorksheet" }}>{{fa-icon "plus"}}</button>
    </li>
  </ul>
</div>

{{outlet}}
